﻿

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Demo1
{
    /// <summary>
    /// Hello 的摘要说明
    /// </summary>
    public class Hello : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string username = context.Request["username"].ToString();
            context.Response.Write("Hello World: " + username +"\n" );

            string fullPath = context.Server.MapPath("~/hello1.htm");//得到文件全路径
            string strHtmlContent = System.IO.File.ReadAllText(fullPath);
            string ispostback = context.Request["ispostback"];
            context.Response.Write(ispostback == "true" ? "首次访问" : "提交按钮访问" + "\n");
        }


        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

    }
}